home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 049a / pmcrose.zip / ROSE.CMD
OS/2 REXX Batch file  |  1991-10-14  |  4KB  |  92 lines

  1. /********************************************************************/
  2. /*  Rose Media Connection Script                                    */
  3. /*                                                                  */
  4. /*  This script is a PMComm 1.09 Rexx script for connecting to Rose */
  5. /*  Media.  It will automatically open the Rose Mail door, upload   */
  6. /*  any reply packet that may be in your \dlx directory, and        */
  7. /*  download messages.                                              */
  8. /*                                                                  */
  9. /*  Note:  If both a reply packet and mail packet exist on your     */
  10. /*         system, the reply packet will be uploaded and deleted,   */
  11. /*         but a message packet will not be downloaded.             */
  12. /*         If a message packet only already exists, it will be      */
  13. /*         deleted, and a new packet downloaded.                    */
  14. /*         This behaviour can be changed easily if desired, but I   */
  15. /*         like it that way!                                        */
  16. /*                                                                  */
  17. /*  N.B.:  This script requires the Rexx Utilities from             */
  18. /*            Pedagogic Software                                    */
  19. /*            W. David Ashley                                       */
  20. /*            5 Timberline Dr.                                      */
  21. /*            Trophy Club, Tx 76262                                 */
  22. /*         in order to work.  These are available on Rose as        */
  23. /*         REXUTL21.ZIP in their most recent incarnation.           */
  24. /********************************************************************/
  25.  
  26. Signal ON SYNTAX NAME SYNTAX_ERROR
  27.  
  28. Parse arg port portname screen_handle dde_output dde_input semaphore
  29. Parse source . . fn .
  30.  
  31. /* This function registers the init_dll function with REXX. The */
  32. /* init_dll function will register the rest of the functions in */
  33. /* the rxpmcomm.dll. */
  34.  
  35. Call RxFuncAdd "init_dll","RxPmcomm","init_dll"
  36. call RxFuncAdd 'RexFileExist','RexxUtil','RexFileExist'
  37. call RxFuncAdd 'RexDelete','RexxUtil','RexDelete'
  38.  
  39. /* Required before any other rxpmcomm.dll functions are called. */
  40. Call init_dll
  41. cr   = '0d'x
  42. crlf = '0a0d'x
  43. Call read_timeout "600000",port
  44.  
  45. Call wait_fore "ter)=no? ","raw",port,screen_handle
  46. Call put_s "n q ns",port
  47. Call wait_fore "st name? ","raw",port,screen_handle
  48. Call put_s "tom koschate c0venant",port
  49. Call wait_fore "er)=yes? ","raw",port,screen_handle
  50. Call put_s "n",port
  51. Call wait_fore "Command? ","raw",port,screen_handle
  52. Call put_s "open 1",port
  53. Call wait_fore "?=help): ","raw",port,screen_handle
  54. if RexFileExist('c:\dlx\rose.rep') then do
  55.     call put_s "u",port
  56.     call wait_fore "DSZ ZModem","raw",port,screen_handle
  57.     call zmodem_send "c:\dlx\rose.rep",dde_output,dde_input
  58.     call RexDelete 'c:\dlx\rose.rep'
  59.     Call wait_fore "?=help): ","raw",port,screen_handle
  60.     if RexFileExist('c:\download\rose.qwk') then do
  61.       Call put_s "g",port
  62.       Exit
  63.     end
  64.     else nop
  65.   end
  66.   else nop
  67.   
  68. if RexFileExist('c:\download\rose.qwk') then call RexDelete 'c:\download\rose.qwk'
  69. else nop
  70.  
  71. call RxFuncDrop 'RexFileExist'
  72. call RxFuncDrop 'RexDelete'
  73.   
  74. Call put_s "d",port
  75. Call wait_fore "t (Y/N)? ","raw",port,screen_handle
  76. Call put_s "y",port
  77. Call wait_fore "DSZ ZModem","raw",port,screen_handle
  78. Call zmodem_receive dde_output,dde_input
  79. Call wait_fore "=help):","raw",port,screen_handle
  80. Call put_s "g",port
  81. Exit 0
  82.  
  83. /* Standard handler for SIGNAL on ERROR, will help in the debuging */
  84. syntax_error:
  85. fp = filespec("path",fn)
  86. fd = filespec("drive",fn)
  87. errormsg = 'REXX error' rc 'in line' sigl':' errortext(rc)
  88. errorfile = fd||fp||"SCRIPT.ERR"
  89. rc = lineout(errorfile,date() time() fn '-' errormsg)
  90. rc = lineout(errorfile,date() time() fn '-' sourceline(sigl))
  91. Exit
  92.